package com.hyb.algorithm.data.struct.str;

/**
 * @Author: huyanbing
 * @Date: 2021/9/9 10:53 上午
 */
public class StringToInt {

    public static void main(String[] args) {
        String t = "122345";

        StringToInt exe = new StringToInt();
        int res = exe.strToInt(t);

        System.out.println(res+1);
    }

    public int strToInt(String str) {

        int n = 0;
        for (int i = 0; i < str.length(); i++) {
            n = n * 10 + (str.charAt(i) - '0');
        }
        return n;
    }
}
